home *** CD-ROM | disk | FTP | other *** search
- Path: pagesat.net!abq-ros.com
- From: <bobakohl@abq-ros.com>
- Date: Sat, 9 Mar 96 20:20:06 -0600
- Newsgroups: comp.lang.c
- Subject: Re: Towers of Hanoi
- Message-ID: <tcpnntpd.16.3.9.20.20.6.2577039569.13293312@abq-ros.com>
- NNTP-Posting-Host: abq-ros.com
- X-MajorTCP-Version: MajorTCP/IP [1.85-8]
-
- -=> Quoting Mhs:guusl@eiffel.com to ** All ** <=-
-
- Mh>
- Mh> Craig Bellet wrote:
- >
- > Learning to program in C++. Assigned problem of moving four progressively
- > larger rings sitting on a peg to another peg one ring at a time. The
- > object is to move the stack of rings to another peg. A small ring may be
- > placed upon a larger ring or an empty peg but not upon a larger ring.
-
- Mh> What ??? You do a) or b) but a) ??? How is that to work ???
-
- What he means to say, is that the larger rings must not be placed upon
- a smaller ring.
-
- > A third peg is to facilitate this by temporarily holding rings. The
- > solution involves recursion but I am unable to figure out the algorithm.
- > Any thoughts?
-
- There is a way to do it, but I'd like to know if he is doing this as
- a homework assignment. I'm not digging out a solution to satisfy a
- homework assignment. Besides, the program I have is strictly in C and
- not a C++ program.
-
- Mh> I can't see any algorithm for this particular problem either.
-
- Mh> If it would have been posted correctly, you won't get any answer here
- Mh> for two sophicticated reasons:
- Mh> a) it's about C++, this group is about C
- Mh> b) it's an assignment, youo have to your homework yourself, as we did
- Mh> that too.
-
- Mh> Guus
-
- Guus, we must stick to our guns about not answering homework
- assignment for these kids. The idea is to "work on it at home", hence
- the name "homework". This presupposes a unsupervised project to test
- comprehension of the necessary C or C++ programming concepts. The kid
- will not learn from this assignment if someone gives him the answer.
- I've seen kids offer money to have their assignements done for them.
- Ridiculous, I guess they want people to think for them. Check into a
- Hotel, kid. They will do everything for you. You don't need to do
- anything, but be prepared to pay dearly for your comfort. Maybe you
- should go into Government work, they are looking for people just like
- you. Guus, we can't give these kids everything on a silver platter.
-
- Bob Kohl
-
- ___ Blue Wave/386 v2.21 [NR]
-
-